<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="z" uri="/WEB-INF/lib/zerdoor.tld"%>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><spring:message code="artist_special.title.msg"/></title>
    <link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
    <%--<script type="text/javascript" src="${path}/style/acg/js/common.js"></script>--%>

    <link href="${path}/plugins/page/kkpager.css" rel="stylesheet">
    <script src="${path}/plugins/page/kkpager.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(function(){

            initBeanInfo(1,12);

        });


        var pageSize = 10;

        function initBeanInfo(page, rows) {

            pageSize = rows;

            var param = {rows:rows, page:page, artist_id:${artistId} };

            $.ajax({
                type: "POST",
                url: "${path}/artistPersonalHome/findUserPhotoByUserId.html",
                data: param,
                dataType: "json",
                success: function(data){


                    var html = "";
                    for(var i in data.list){

                        var bean = data.list[i];

                        html += "<div class=\"art_albumlist\">";
                        html += "   <div class=\"photolist\">";
                        html += "   <ul class=\"clearfix\">";

                        for(var j in bean.works){

                            var minBean = bean.works[j];

                            html += "   <li onclick=\"f_toProduction('"+minBean.works_id+"')\"><img value='"+minBean.works_id+"' src='${path}/"+minBean.cover+"' width=\"80\" height=\"80\" /></li>";
                        }


                        html += "  <li style='' onclick=\"f_production("+bean.photo_id+")\"><a>……</a></li>";
                        html += "  </ul>";
                        html += "  </div>";
                        html += " <h3><a href=\"javascript:f_production("+bean.photo_id+")\" value='"+bean.photo_id+"'>"+bean.photo_name+"</a></h3>";
                        html += "  </div>";

                    }


                    $("#dataDiv").html(html);

                    var pager = data;
                    //分页
                    createPage(pager.pageNum, pager.pages, pager.total);

                }
            });
        }


        //分页方法
        //currentPage 当前页
        //rows 每页条数
        //total 总数
        function createPage(currentPage, totalPage, totalCount) {
            var totalPage = totalPage;
            var totalRecords = totalCount;
            var pageNo = currentPage;
            if (!pageNo) {
                pageNo = 1;
            }
            //生成分页
            //有些参数是可选的，比如lang，若不传有默认值
            kkpager.generPageHtml({
                pno: pageNo,
                //总页码
                total: totalPage,
                //总数据条数
                totalRecords: totalRecords,
                //链接前部
                hrefFormer: 'index',
                //链接尾部
                hrefLatter: '',
                //是否显示总页数
                isShowTotalPage: true,
                //是否显示总记录数
                isShowTotalRecords: true,
                //是否显示页码跳转输入框
                isGoPage: true,
                //getLink: function (n) {
                //    return this.hrefFormer + this.hrefLatter + "?pno=" + n;
                //}
                //,
                mode : 'click',//默认值是link，可选link或者click
                click : function(n){
                    //this.selectpage(n);
                    initBeanInfo(n, pageSize);
                    return false;
                },
                lang				: {
                    firstPageText			: '<spring:message code="firstPageText"/>',
                    firstPageTipText		: '<spring:message code="firstPageTipText"/>',
                    lastPageText			: '<spring:message code="lastPageText"/>',
                    lastPageTipText			: '<spring:message code="lastPageTipText"/>',
                    prePageText				: '<spring:message code="prePageText"/>',
                    prePageTipText			: '<spring:message code="prePageTipText"/>',
                    nextPageText			: '<spring:message code="nextPageText"/>',
                    nextPageTipText			: '<spring:message code="nextPageTipText"/>',
                    totalPageBeforeText		: '<spring:message code="totalPageBeforeText"/>',
                    totalPageAfterText		: '<spring:message code="totalPageAfterText"/>',
                    totalRecordsAfterText	: '<spring:message code="totalRecordsAfterText"/>',
                    gopageBeforeText		: '<spring:message code="gopageBeforeText"/>',
                    gopageButtonOkText		: '<spring:message code="gopageButtonOkText"/>',
                    gopageAfterText			: '<spring:message code="gopageAfterText"/>',
                    buttonTipBeforeText		: '<spring:message code="buttonTipBeforeText"/>',
                    buttonTipAfterText		: '<spring:message code="buttonTipAfterText"/>'
                }
            },true);
        }

        //跳转到作品集
        function f_production(id){

            window.location.href = "${path}/artistPersonalHome/artistProduction.html?photo_id="+id;

        }

        /**
         * 跳转作品信息
         * @param production_id 作品ID
         */
        function f_toProduction(production_id){

            window.location.href = "${path}/artistPersonalHome/browseProduction.html?production_id="+production_id;

        }

    </script>

</head>

<body>
<div class="header">
    <jsp:include page="../public/header.jsp">
        <jsp:param    name="home"    value="dddd"    />
    </jsp:include>
</div>
<%--<div class="navbox">--%>
    <%--<div class="wrapper">--%>
    	<%--<ul class="navlist">--%>
            <%--<li><a href="index.html" class="dh_pack on">首页</a></li>--%>
            <%--<li><a href="Official.html" class="dh_pack">艺术家档案</a></li>--%>
            <%--<li><a href="" class="dh_pack">作品</a></li>--%>
            <%--<li><a href="Artist.html" class="dh_pack">交易评价</a></li>--%>
            <%--<li><a href="Contest.html" class="dh_pack">交易记录</a></li>--%>
        <%--</ul>--%>
    <%--</div>--%>
<%--</div>--%>
<div id="container">
    <div class="wrapper">
        <div class="listbox">
            <div class="modetitle">
                <spring:message code='artist_special.msg.currentLocation' />：<a href="${path}">ACG</a> >
                <a href="${path}/artistPersonalHome/artistPersonalHome.html?receiver=${navigation.artist_id}"><spring:message code='artist_special.msg.homepage' arguments='${navigation.real_name}' argumentSeparator=','/></a> >
                <spring:message code='artist_special.msg.collections' />
            </div>
            <div class="reelscontainer">
            <div class="art_albumbox clearfix" id="dataDiv">


                    <div class="clr"></div>
                </div>
                <div class="pagebox">
                    <div class="pagebox">
                        <div id="kkpager" style="text-align: center"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="footer">
    <!--content-->
    <jsp:include page="../public/footer.jsp"></jsp:include>
</div>

</body>
</html>
